<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <link rel="stylesheet" th:href="@{/js/layuiadmin-1.2.1/style/dtree/dtree.css}" media="all"/>
    <link rel="stylesheet" th:href="@{/js/layuiadmin-1.2.1/style/dtree/font/dtreefont.css}" media="all">
    <th:block th:include="include :: header('资料文件')" />
</head>
<body class="no-skin">
<style>
	.west {width:310px;}
    .layui-body {left:310px; border-left: 10px solid #F2f2f2; border-bottom: 0;}
    .layui-card-header{border:none;display:flex;justify-content: flex-end;align-items: center;}
    .layui-form-item{justify-content: flex-end;align-items: center;flex-wrap: wrap;}
    .layui-form-item .layui-inline{margin-bottom:0;}
    .btn-type{padding:0 13px;line-height:32px;height:32px;}
    .layui-side-scroll{border-right: 1px solid #f6f6f6;}
    .layui-logo{color: #fff;height: 41px;line-height: 41px;font-size: 16px}
    .layui-logo span{display: block;width: 277px;float: left;margin-left: 10px;}
    .layui-col-sm4 {width: 23%;}
    .layui-btn-primary{background-color:#f2f2f2;}
    .layui-side-scroll{width:310px;}
    .new_btn{background-color:#00A115;}
    .process_btn{background-color:#00A115;}
    .edit_btn{background-color:#F3A041;}
    .delete_btn{background-color:#C80000;}
    .layui-btn-primary i::before{color:#fff;}
    .layui-btn-xs {height: 32px;line-height: 32px;padding: 0 16px;font-size: 12px;}
    label.layui-form-label {width: 95px;padding-right: 0px;font-size:14px;color:#142A48;}
    .layui-nav {background: #FFF;color:#000;width:310px;}
    .layui-btn+.layui-btn {margin-left: 16px;}
    .max-warn{float:right;}
    .layui-table-tool-temp{padding-right:0}
    .dtree-nav-item {padding-left: 16px;}
    .layui-icon-shrink-right:before {background-color:rgba(243,160,65,0.9)}
    .layui-icon-spread-left:before {background-color:rgba(243,160,65,0.9)}
    .name-input{width:188px;}
    .layui-layer-title{background: #0087FA;color: #FFFFFF}
    #btn-reset span{color:#142A48 !important;}
    .layuiadmin-card-header-auto{padding: 0px 20px 0px 0px !important;}
    .layui-table-tool {min-height: 42px;padding: 6px 8px;background-color: #F2F2F2 !important;}
</style>
<div class="main-container" id="main-container">
    <div class="main-content">
        <div class="west layui-side">
            <div class="layui-side-scroll">
                <div class="layui-logo">
                    <span>资料库</span>
                    <a href="javascript:;"  class="menuBtn">
                        <i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible" style="color: #fff;float: right"></i>
                    </a>
                </div>
                <div class="layui-nav layui-nav-tree">
                    <div th:if="${buttonState['treebtn']} eq 'enable'"  style="text-align: center;margin: 12px 0 5px;">
                        <button class="layui-btn layui-btn-xs layui-btn-primary new_btn" dtree-id="dhtree" dtree-menu="folder" title="新增文件夹"><i class="dtreefont dtree-icon-fenzhijigou"></i></button>
                        <button class="layui-btn layui-btn-xs layui-btn-primary process_btn" dtree-id="dhtree" dtree-menu="manager" title="文件夹管理员"><i class="dtreefont dtree-icon-yonghu"></i></button>
                        <button class="layui-btn layui-btn-xs layui-btn-primary edit_btn" dtree-id="dhtree" dtree-menu="bianji" title="编辑"><i class="dtreefont dtree-icon-bianji"></i></button>
                        <button class="layui-btn layui-btn-xs layui-btn-primary delete_btn" dtree-id="dhtree" dtree-menu="shanchu" title="删除"><i class="dtreefont dtree-icon-roundclosefill"></i></button>
                    </div>
                    <div id="dhtree" class="demo-tree demo-tree-box"></div>
                </div>
            </div>
            <div class="panel layout-expand layui-expand-west" id="panel" style="display: none; width: 114px; left: 0px; top: 0px;height: 41px;color: #fff;">
                <div class="panel-header">
                    <div class="panel-tool"  id="panel-tool" style="text-align: center; width: 114px;height: 41px;line-height: 41px;font-size: 16px;">
                        <span class="panel-body panel-title" style="width: 114px;">资料库</span>
                    <a href="javascript:;" class="menuBtn">
                            <i class="layui-icon layui-icon-spread-left" id="LAY_app_flexible" style="color: #fff;float: right"></i>
                        </a>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-body" id="LAY_app_body">
            <div class="north">
                <div class="north-content">
                    <form class="layui-form dis-ctr" >
                        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">文件名：</label>
                                    <div class="layui-input-block">
                                        <input id="vname" type="text" name="vname" autocomplete="off" class="layui-input name-input" style="width:280px;">
                                    </div>
                                </div>
                                <div class="layui-inline" style="line-height: 32px;">
                                    <a class="layui-btn layuiadmin-btn-order dhicon dh-search btn-type" id="btn-search"><span class="fa_span">查询</span></a>
                                    <button type="reset" class="layui-btn layui-btn-primary dhicon dh-refresh btn-type" id="btn-reset"><span class="fa_span">重置</span></button>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            <div class="mid-content">
                <table class="layui-hide" id="dhtable" lay-filter="ftable"></table>
            </div>
        </div>
    </div>
</div>
<div id="folder" style="display: none;width: 80%;margin-top: 10px;">
    <form class="post_form">
        <input type="hidden" name="guid" id="guid">
        <input type="hidden" name="pguid" id="pguid">
        <div class="layui-form-item">
            <label class="layui-form-label">上级：</label>
            <div class="layui-input-block">
                <input type="text" id="pname" readonly="readonly" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><font class="f_red">*</font>名称：</label>
            <div class="layui-input-block">
                <input type="text" name="folderName" id="folderName" autocomplete="off" class="layui-input">
            </div>
        </div>
    </form>
</div>
<div id="managerlist" style="display: none;width: 100%;margin-top: 10px;">
	<table class="layui-hide" id="dhtable1" lay-filter="ftable1"></table>
</div>
<script type="text/html" id="managerBarDemo">
{{# if(d.managerOrg == '【上级】管理者'){ }}
	<a class="layui-btn layui-btn-disabled layui-btn-xs dhicon dh-remove" >删除</a>
{{# }else{}}
	<a class="layui-btn layui-btn-danger layui-btn-xs dhicon dh-remove" lay-event="del">删除</a>
{{# } }}
</script>
<script type="text/html" id="toolbar1">
    <div class="layui-btn-container">
		<div class="layui-btn layui-btn-normal layui-table-tools" lay-event="addorgmanager">
			<i class="dhicon dh-plus"></i> 新增管理者
        </div>
    </div>
</script>
<script type="text/html" id="toolbar">
    <div class="layui-btn-container">
		<div class="layui-btn layui-btn-normal layui-table-tools" lay-event="addfile" id="addfile">
			<i class="dhicon dh-plus"></i> 新增资料
        </div>
		<div class="layui-btn layui-btn-danger layui-table-tools" lay-event="delfile" id="delfile">
			<i class="dhicon dh-remove"></i> 删除
        </div>
		<p class="max-warn">上传单文件最大 <span class="f_red">[[${maxFileSize}]]</span></p>
    </div>
</script>
<script type="text/html" id="barDh">
    <a class="layui-btn layui-btn-xs dhicon dh-search file-view" lay-event="view" title="查看"></a>
    <a class="layui-btn layui-btn-xs dhicon dh-download" lay-event="download" title="下载"></a>
{{# if(d.createUser == "[[${session.mandatorUser.userId}]]" || [[${session.mandatorUser.userLevel}]] > 5){ }}
    <a class="layui-btn layui-btn-danger layui-btn-xs dhicon dh-remove" lay-event="del" title="删除"></a>
{{# } }}
 </script>
<th:block th:include="include :: footer" />
  <script th:src="@{/dhecp/js/left-tree.js?v=2}"></script>
<script type="text/javascript">
 /*<![CDATA[*/
 var userId = "[[${session.mandatorUser.userId}]]";
    userLevel = "[[${session.mandatorUser.userLevel}]]",
    uploadUrl = "[[${uploadUrl}]]",
    createUser = "[[${createUser}]]",
    buttonState = "[[${buttonState['treebtn']}]]";
 /*]]>*/
var upfileMark = 'root';//节点guid
	fromModule = moduleFile = fieldName = "datafolder";
	vType = "datafile";
// $(".layui-logo").css("background",$(".layui-layout-admin .layui-logo", parent.document.body).css("backgroundColor"));
$(".layui-logo").css({"background":pellucidityTen,"text-align":"center"});
// $(".layui-expand-west").css("background",$(".layui-layout-admin .layui-logo", parent.document.body).css("backgroundColor"));
$(".layui-expand-west").css({"background": pellucidityTen,position: "absolute"});
var vtype = "",pguid="",pOrgName="",ppOrgName="",orgPathAll='orgPathAll',childlist=[];
var vname = "无",pvname = "无",guid = 'null',CommonTreet,upload;
layui.extend({
    dtree : '/js/layuiadmin-1.2.1/lib/extend/dtree-tp'
}).use(['table','form','layer','jquery', 'util','dtree','upload'], function () {
    var $ = layui.$,layer = layui.layer,table = layui.table,form = layui.form,util = layui.util,dtree = layui.dtree;upload = layui.upload;
    var treeData = getTree('/system/datafolder/listtreejson');
    CommonTreet = dtree.render({
        elem: "#dhtree",
        menubar:true,
        record:true,
        toolbar:true,
        toolbarWay:"follow",
        // toolbarShow:["edit"],
        toolbarShow:[], // 默认按钮制空
        toolbarExt:[{toolbarId: "nodeSort",icon:"dtree-icon-sort",title:"节点排序",handler: function(node,$div){
                console.log(node);
                $.modal.open("节点排序", "/system/datafolder/datafoldersort?pguid="+node.nodeId, 350, 400, function(index){
                    var res = window["layui-layer-iframe" + index].callbackdata();
                    $.operate.post("/system/datafolder/updateiidbyguid", {'infoItems':JSON.stringify(res)},function(result){
                        allReload(result)
                    });
                });
            }
        }],
        toolbarFun: {
            loadToolbarBefore: function(buttons, param, $div){
                if(param.leaf || buttonState != 'enable'){ // 如果是叶子节点
                    buttons.nodeSort = "";  // 取消排序功能
                }
                return buttons; // 将按钮对象返回
            }
        },
        data: treeData,
        menubarTips:{
            freedom:[{
                menubarId:"folder",handler:function(node){nodeHandler(node,'新增文件夹','addfolder');}
            },{
                menubarId:"manager",handler:function(node){nodeHandler(node,'文件夹管理员','managerlist');}
            },{
                menubarId:"bianji",handler:function(node){nodeHandler(node,'修改','edit');}
            },{
                menubarId:"shanchu",handler:function(node){nodeHandler(node,'删除','delete');}
            }
            ],
            group:[] // 按钮组制空
        }
    });
    //取消树节点选中
    $(document).bind('click', function(event) {
        var evt = event.srcElement ? event.srcElement : event.target;
        evt = $(evt);
        if(evt.hasClass("layui-nav-tree") || evt.parents(".layui-nav-tree").length != 0 || evt.hasClass("layui-layer-page") || evt.parents(".layui-layer-page").length != 0
            || evt.hasClass("layui-body") || evt.parents(".layui-body").length != 0 || evt.hasClass("layui-layer-btn") || evt.parents(".layui-layer-btn").length != 0
            || evt.hasClass("layui-layer-setwin") || evt.parents(".layui-layer-setwin").length != 0)
            return;
        else{
            CommonTreet.cancelNavThis();
            vtype = "",pguid="",guid="",pOrgName="",ppOrgName="";
        };
    });
    function nodeHandler(node,dname,action){
        console.log("pguid",pguid)
        var purl;
        if(Object.keys(node).length==0 && action != 'addfolder'){
            layer.msg("请选择节点");
        }else{
            if(action != 'edit' && action != 'delete'){
                $('.post_form')[0].reset();
                $("#pguid").val(pguid);
                if(pOrgName){
                    $("#pname").val(pOrgName);
                }else{
                    $("#pname").val("顶级");
                    $("#pguid").val("root");
                }
                purl = '/system/datafolder/addpost';
            }else{
                ppOrgName?$("#pname").val(ppOrgName):$("#pname").val("顶级")
                $("#guid").val(pguid);
                $("#folderName").val(node.context);
                purl = '/system/datafolder/editorgnamepost';
            }
            if(action == 'delete'){
            	var parentObj = dtree.getParentParam(CommonTreet, pguid);
            	pguid = parentObj.nodeId;
            	pOrgName = parentObj.context;
                if(Object.keys(childlist).length > 0){
                    $.modal.confirmCom('当前选中的节点下有子级，确定要一起删除么？',function(){deletepost(orgPathAll);$('.post_form')[0].reset();});
                }else{
                    $.modal.confirmCom('你确定删除么？',function(){deletepost(orgPathAll);$('.post_form')[0].reset();});
                }
            }else if(action == 'managerlist'){
                table.reload('dhtable1', {url: "/system/datafolder/managersAlllistjson?guid="+upfileMark,page:{curr: 1}});
            	$.modal.openHtml(dname,'600','400',"managerlist",purl,"post_form",function(result){
                    allReload(result);
                },'',true);
            }else{
                $.modal.openHtml(dname,'400','280',"folder",purl,"post_form",function(result){
                    allReload(result);
                },'',true);
            }
        }
    }
    dtree.on("node('dhtree')" ,function(obj){
    	upfileMark = obj.param.nodeId;
    	pguid = obj.param.nodeId;pOrgName = obj.param.context;ppOrgName = obj.parentParam.context,childlist = obj.childParams;
        table.reload('dhtable', {url: "/system/fileinfo/list?fileMark="+obj.param.nodeId+"&fieldName=datafolder",toolbar: '#toolbar',page:{curr: 1}});
        if(upfileMark)initAddfile();
    	var recordData = JSON.parse(obj.param.recordData);
        orgPathAll = recordData['orgPathAll'];
    	if(typeof recordData['folderManagersAll'] == 'string'){
            if(recordData['folderManagersAll'].indexOf("["+userId+"]") >= 0 ) {
                $(".layui-table-tool").css('display','inline-block');
            }else{
                $(".layui-table-tool").css('display','none');
            }
        }
    });
    //管理员列表
    $.tablelist.init({
        elem: '#dhtable1'
        ,url: "/system/datafolder/managersAlllistjson?orgPathAll="+orgPathAll
        ,cols: [[
            {type:'numbers', fixed: 'left'}
            ,{fixed:'left', title: '操作',align: 'center',width: 100, toolbar: '#managerBarDemo'}
            ,{field:'userId', title: '用户编号',align: 'center',width: 100}
            ,{field:'userName', title: '用户名称',align: 'center',width: 100}
            ,{field:'userLevel', title: '用户级别',align: 'center',width: 100}
            ,{field:'managerOrg', title: '管理者来源',align: 'center',width: 150}
            ,{field:'guid', title: 'ID',hide:true}
        ]
        ]
        ,toolbar: '#toolbar1'
        ,height:280
        ,width:'full-' + 110
    })
    //头工具栏事件
    table.on('toolbar(ftable1)', function(obj){
        if(obj.event == 'addorgmanager')
            addUser('/system/datafolder/addorgmanagerspost','新增管理员','managers');
    });
    //监听工具条
    table.on('tool(ftable1)', function (obj) {
        var data = obj.data;
        if(obj.event === 'del'){ //删除
            var pdata = {'guid':pguid,'orgid':data.userId}
            $.modal.confirmCom('确定要删除么？',function(){deleteUser('/system/datafolder/deleteorgmanagerspost',pdata)});
        }
    });

    // $(".menuBtn i").on('click', function() {//隐藏显示侧边
    //     console.log("侧边伸缩事件")
    //     var btn = $(this);
    //     	if (btn.hasClass('layui-icon-shrink-right')) {
	//         	$(".west").animate({ width: '114px' });
	//         	$(".layui-body").animate({ left: '0' });
	//         	$(".layui-footer").animate({ left: '0' });
    //     	} else {
    //     		var widthV = '367px', leftV = '367px';
    //     		if(fromModule == "organization"){
    //     			widthV = '290px', leftV = '295px';
    //     		}
    //     		$(".west").animate({ width: widthV });
    //     		$(".layui-body").animate({ left: leftV });
    //     		$(".layui-footer").animate({ left: leftV });
    //     	}
    //     $(".layui-side-scroll").animate({ width: 'toggle' });
    //     $(".layui-expand-west").animate({ width: 'toggle' });
    // })
    
  	//获取树数据
    function getTree(url){
        var data = [];
        $.ajax({
            url: url,    //后台数据请求地址
            data: {id: 11},        //id为加载当前角色的权限菜单，为角色id
            type: "post",
            async:false,
            success: function(resut){
                data = resut;
            }
        });
        return data;
    }
    
    $.tablelist.init({
        elem: '#dhtable'
        ,url: "/system/fileinfo/list?fileMark=root&fieldName=datafolder"
        ,cols: [[
            {type:'numbers', fixed: 'left'}
           	,{type: 'checkbox', fixed: 'left'}
            ,{field:'fileName', title: '文件名',align: 'left',width: 720}
            ,{field:'fileSize', title: '大小',align: 'left',width: 100}
            ,{field:'fileType', title: '类型',align: 'left',width: 100}
            ,{field:'createUserName', title: '上传者',align: 'center',width: 120}
            ,{field: 'filePath',title: 'filePath',hide:true}
            ,{field: 'guid',title: 'guid',hide:true}
            ,{title: '操作',align: 'center',width:220,templet:'#barDh'}
        ]
        ]
    	,height:'full-' + 110
        ,width:'full-' + 260
        ,done: function(res, curr, count){
        	fileCount = count;
        	var state = "";
            for (var i in res.data) {
                var item = res.data[i];
                if (item.createUser != userId && userLevel < 6) {// 这里是判断需要禁用的条件（如：状态为0的）
                    // checkbox 根据条件设置不可选中
                    $('tr[data-index=' + i + '] input[type="checkbox"]').prop('disabled', true);
                    state = "1";// 隐藏表头全选判断状态
                    form.render();// 重新渲染一下
                }
            }
         	// 根据条件移除全选 checkbox
            if(state == "1")$('th[data-field=1] div').html('');
        }
    });

  	
  	//头工具栏事件
    table.on('toolbar(ftable)', function(obj){
      var checkStatus = table.checkStatus(obj.config.id);
      switch(obj.event){
        case 'addfile':
        	if(!upfileMark)layer.msg("请选择节点");
        break;
        case 'delfile':
          var data = checkStatus.data,infoItems = [];
          $.each(checkStatus.data,function(i,v){
        	  infoItems.push({guid:v.guid,filePath:v.filePath});
          })
          $.operate.remove('确定要删除么？','/system/fileinfo/delete',{infoItems:JSON.stringify(infoItems)},function(result){
          	layer.closeAll();
          	table.reload('dhtable', {url: "/system/fileinfo/list?fileMark="+upfileMark+"&fieldName=datafolder",page:{curr: 1}});
          	initAddfile();
          });
        break;
      };
    });
  	
  	//监听工具条
    table.on('tool(ftable)', function (obj) {
        var data = obj.data;
        switch(obj.event){
        	case 'del':
        		$.operate.remove('确定要删除么？','/system/fileinfo/delete',{infoItems:JSON.stringify([{guid:data.guid,filePath:data.filePath}])},function(result){
                	layer.closeAll();
                    table.reload('dhtable', {url: "/system/fileinfo/list?fileMark="+upfileMark+"&fieldName=datafolder",page:{curr: 1}});
                    initAddfile();
                });
       		break;
        	case 'download':
    			fetch(data.filePath).then(res => res.blob().then(blob => {
    			    let a = document.createElement('a');
    			    let url = window.URL.createObjectURL(blob);
    			    a.href = url;
    			    a.download = data.fileName + '.' + data.fileType;
    			    a.click();
    			    window.URL.revokeObjectURL(url);
    			}))
    			break;
        	case 'view':
        		window.open(data.filePath);
       		break;
        }
    });
  	function initAddfile(){
  		var uploadData = {'moduleFile':moduleFile, 'vType':vType, 'fileMark':upfileMark, 'fieldName':fieldName,'createUser':createUser};
        $.uploadFile.common('#addfile', uploadUrl, 'file', '', uploadData, true, "/system/fileinfo/list?fileMark="+upfileMark+"&fieldName=datafolder");
  	}
  	
  	
    $('#btn-search').on('click', function () {
        var filename = $("#vname").val();
        table.reload('dhtable', {url: "/system/fileinfo/list?fileMark="+upfileMark+"&fileName="+filename+"&fieldName=datafolder",toolbar: '',page:{curr: 1}});
    });
    //删除操作
    function deletepost(orgPathAll){
        var deldata = {'orgPathAll':orgPathAll};
        $.operate.post('/system/datafolder/deletesubtreepost',deldata,function(result){
            allReload(result)
        });
    }
    /*
    *url:保存路径
    *title:弹出层标题
    *type:managers:新增管理员；users:新增员工
    */
    function addUser(url,title,type){
        if(pguid){
            $.modal.open(title,'/system/datafolder/orgusersadd?pagetype=managers'+type+'&guid='+pguid,'700','450',function(index){
                var res = window["layui-layer-iframe" + index].callbackdata();
                if(res.length > 0){
                	var userList = [];
                   	$.each(res,function(index,element){
                   		userList.push({'orgid':element['userId']})
                   	})
                       var pdata = {'guid':pguid,'userList':JSON.stringify(userList)};

                    $.operate.post(url,pdata,function(result){
                        allReload(result)
                    });
                }else{
                    layer.msg("请选择人员！");
                }
            })
        }else{
            layer.msg("请选择节点");
        }
    }
    /*
    *删除管理员、员工
    *url:删除路径
    *padata:条件对象
    */
    function deleteUser(url,pdata){
        $.operate.post(url,pdata,function(result){
            allReload(result)
        });
    }
    //重新加载
    function allReload(result){
        if(result.code==0){
            setTimeout(function(){
                layer.closeAll();
                table.reload('dhtable1', {url: "/system/datafolder/managersAlllistjson?orgPathAll="+orgPathAll,page:{curr: 1}});
                dtree.reload(CommonTreet,{
                    elem: "#dhtree",
                    data: getTree('/system/datafolder/listtreejson'),
                    done: function(){
                        var params = dtree.dataInit("dhtree", pguid);
                    }
                });
            }, 1000);
        }
    }
 //    //自由移动的元素
 // 	// 初始化拖放对象
 //    var box = document.getElementById("panel");
 //    var lay_app_body = document.getElementById("LAY_app_body");
 // // 获取页面中被拖放元素的引用指针
 //    box.style.position = "absolute";  	// 绝对定位
 //    box.style.width = "114px";
 //    box.style.height = "41px";  		// 定义高度
 //    box.style.backgroundColor = pellucidityTen;  // 定义背景色
 //    box.style.zIndex = "999999999999";  // 定义背景色
 //
 //    var y = 0;
 //    var t = 0;
 //    var isDown = false;
 //    //鼠标按下事件
 //    box.onmousedown = function(e) {
 //        //获取x坐标和y坐标
 //        y = e.clientY;
 //        //获取左部和顶部的偏移量
 //        t = box.offsetTop;
 //        //开关打开
 //        isDown = true;
 //        //设置样式
 //        box.style.cursor = 'move';
 //    }
 //    //鼠标移动
 //    window.onmousemove = function(e) {
 //        if (isDown == false) {
 //            return;
 //        }
 //        //获取x和y
 //        var ny = e.clientY;
 //        if(ny <= box.clientHeight){
 //        	ny = box.clientHeight
 //        }
 //        //计算移动后的左偏移量和顶部的偏移量
 //        var nt = ny - (y - t);
	// 	if(lay_app_body.clientHeight - box.clientHeight <= nt){
	// 		nt = lay_app_body.clientHeight - box.clientHeight
	// 	}
 //        box.style.top = nt + 'px';
 //    }
 //    //鼠标抬起事件
 //    box.onmouseup = function() {
 //        //开关关闭
 //        isDown = false;
 //        box.style.cursor = 'default';
 //    }
    
});
</script>
</body>
</html>